#########################################################
# Table 3: Fractional difference (d-value) in each case #
#########################################################

#library
library(fracdiff)

#######USA################
#load usa data
usa<-read.csv("usa_macropartisanship.csv")
attach(usa)

#fractional integration
fdGPH(usa.macropartisanship_USA)

######UK##################
#load uk dataset 
uk<-read.csv("uk_macropartisanship.csv")
attach(uk)

#fractional integration
fdGPH(df_mp_uk.macropartisanship_UK)



#######JAPAN################

#load japan dataset 
jp<-read.csv("japan_macropartisanship.csv")
attach(jp)

#fractional integration
fdGPH(na.omit(b.macropartisanship_jp))



#######GERMANY################

#load german dataset 
ger<-read.csv("german_macropartisanship.csv")
attach(ger)

#fractional integration
fdGPH(na.omit(df_meangr.macropartisanship_GR))



#######DENMARK################
#load denmark dataset 
den<-read.csv("denmark_macropartisanship.csv")
attach(den)

#fractional integration
fracdiff(na.omit(denmark_final.macropartisanship_DNK))


